<?php 
$url = $_GET['url'];
$url = strip_tags($url);
$data = @file_get_contents($url);

$ext = substr($url, -3);
header('Content-Type: image/' . $ext);
echo $data;